/**
 * 
 */
package mdb.com.vn.persist;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import org.springframework.stereotype.Repository;

import mdb.com.vn.model.IBankingSms;

/**
 * @author tu.dod
 *
 */
@Repository("iBankingSmsDAO")
public class IBankingSmsDAOImpl extends AbstractHibernateDAOImpl<IBankingSms, Integer> implements IBankingSmsDAO,Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@Override
	public IBankingSms findByProperties(String gcif, Date processDate) {
		// TODO Auto-generated method stub
		return (IBankingSms) getSession().getNamedQuery("IBankingSms.findByStatusProcessDate").setString("customerId", gcif).setDate("processDate", processDate).uniqueResult();
	}

	@Override
	protected Class<IBankingSms> getDomainClass() {
		// TODO Auto-generated method stub
		return IBankingSms.class;
	}

	@SuppressWarnings("unchecked")
	@Override
	public List<IBankingSms> findByDateStatus(String status, Date processDate) {
		// TODO Auto-generated method stub
		return getSession().getNamedQuery("IBankingSms.findByStatusDate").setString("status", status).setDate("processDate", processDate).list();
	}

	@SuppressWarnings("unchecked")
	@Override
	public List<IBankingSms> findByProperties(String status) {
		// TODO Auto-generated method stub
		return getSession().getNamedQuery("IBankingSms.findByStatus").setString("status", status).list();
	}
	@Override
	public IBankingSms findIBSmsById(long id) {
		// TODO Auto-generated method stub
		return (IBankingSms) getSession().get(IBankingSms.class, id);
	}

}
